<template>
    <!-- 组件的结构 -->
    <div class="app">
        <CategoryTest title="美食">
            <img slot="center" src="https://s3.ax1x.com/2021/01/16/srJlq0.jpg" alt="">
            <a slot="footer" href="http://www.baidu.com" class="food">更多美食</a>
        </CategoryTest>
        <CategoryTest title="游戏">
            <ul  slot="center">
            <li v-for="(item,index) in games" :key="index">{{item}}</li>
            </ul>
            <a slot="footer" href="http://www.baidu.com">单机游戏</a>
            <a slot="footer" href="http://www.baidu.com">网络游戏</a>
        </CategoryTest>
        <CategoryTest title="电影">
            <video slot="center" src="http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4" controls></video>
            <template v-slot:footer><!-- 新的写法 只能用于template中 -->
                <div>
                    <a href="http://www.baidu.com">经典</a>
                    <a href="http://www.baidu.com">热门</a>
                    <a href="http://www.baidu.com">推荐</a>
                    <h4>欢迎观看！！！</h4>
                </div>
            </template>
        </CategoryTest>
    </div>  
</template>

<script>
    import CategoryTest from './components/Category-test.vue';
    export default{
    name: "App",
    data() {
        return {
            foods:['火锅','烧烤','小龙虾','牛排'],
            games:['红色警戒','穿越火线','英雄联盟','qq飞车'],
            films:['《黑马》','《尚硅谷》','《环太平洋》','《战狼》']
        }
    },
    components: { CategoryTest }
}
</script>

<style scoped>
    .app{
        display: flex;
        justify-content: space-around;
    }
    img{
        width: 100%;
   }
   video{
    width: 100%;
   }
   a{
    padding-left: 10px;
    margin: 10px 10px;
   }
   .food{
    margin: 0 50px;
   }
   h4{
    text-align: center;
   }
</style>